SlideShare a Scribd company logo
Graph API
Facebook Developer Garage Taipei


          CardinalBlue


 john, godfat @
Graph API

•What is it?
• What to do?
• What’s new?
Graph API: What is it?


• Launched at F8 (April 2010)
• Simple REST API
• Completely new!
Your apps
will fail...
soon.


    APP
http://graph.facebook.com
http://graph.facebook.com/cocacola/picture
http://graph.facebook.com/hellokitty/picture
http://graph.facebook.com/4/picture
http://graph.facebook.com/search?q=taiwan
http://graph.facebook.com/hellokitty
{
   "id": "40444963499",
   "name": "Hello Kitty",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/
hs625.ash1/27537_40444963499_5441_s.jpg",
   "link": "http://www.facebook.com/hellokitty",
   "category": "Public_figures_other",
   "username": "hellokitty",
   "affiliation": "Sanrio Inc. USA",
   "birthday": "11/01/-001",
   "personal_info": "Hello Kitty's Official Fan Page!nHello Kitty lives in the
suburbs of London with her parents and her twin sister Mimmy. She has lots of
friends at school with whom she shares many adventures.nHer trademark is
her red bow that she always wears over her left ear.nHello Kitty is as heavy as
three apples and as tall as five apples.",
   "personal_interests": "Traveling, listening to music, reading, eating yummy
cookies, and making new friends. As Hello Kitty always says, u201cYou can
never have too many friends!"nShe collects small, cute objects like ribbons,
hair accessories, candy, stars, and goldfish.",
   "fan_count": 267913,
   "type": "page"
}
Connections
http://graph.facebook.com/hellokitty?metadata=1

   "metadata": {
     "connections": {
       "feed": "http://graph.facebook.com/hellokitty/feed",
       "posts": "http://graph.facebook.com/hellokitty/posts",
       "tagged": "http://graph.facebook.com/hellokitty/tagged",
       "statuses": "http://graph.facebook.com/hellokitty/statuses",
       "links": "http://graph.facebook.com/hellokitty/links",
       "notes": "http://graph.facebook.com/hellokitty/notes",
       "photos": "http://graph.facebook.com/hellokitty/photos",
       "albums": "http://graph.facebook.com/hellokitty/albums",
       "events": "http://graph.facebook.com/hellokitty/events",
       "videos": "http://graph.facebook.com/hellokitty/videos"
     }
   }
object

         connection
                      objects
http://graph.facebook.com/hellokitty/posts
{
   "data": [
      {
         "id": "40444963499_420034668499",
         "from": {
             "name": "Hello Kitty",
             "category": "Public_figures_other",
             "id": "40444963499"
         },
         "message": "Check out the cute Hello Kitty Nerds tote featured in Us Weekly! Find this and more Hello Kitty
u201cNerdsu201d stuff at Sanrio.com and select Sanrio Boutiques.nnhttp://bit.ly/brVYHTn",
         "picture": "http://photos-h.ak.fbcdn.net/hphotos-ak-ash2/
hs003.ash2/33501_420032663499_40444963499_4947695_6515646_s.jpg",
         "link": "http://www.facebook.com/photo.php?pid=4947695&fbid=420032663499&id=40444963499",
         "name": "Nerd Alert!",
         "caption": "5 new photos",
         "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif",
         "type": "photo",
         "created_time": "2010-08-20T01:04:30+0000",
         "updated_time": "2010-08-20T01:04:30+0000",
         "likes": 892,
         "comments": {
             "count": 76
         }
      },
      {
         "id": "40444963499_419689583499",
         "from": {
             "name": "Hello Kitty",
             "category": "Public_figures_other",
             "id": "40444963499"
         },
         "message": "Weu2019ve been playing with the Hello Kitty 35 mm Fisheye camera by Lomography and wanted to share
some of the fun pictures weu2019ve taken! Has anyone else taken any awesome pictures with their Hello Kitty Fisheye
cameras? Post them to our wall, we wanna see them! nnThe Hello Kitty Fisheye Camera is now available at Sanrio.com, select
Sanrio Boutiques, Urban Outfitters, Lomography.com and Lomography gallery stores. nnhttp://bit.ly/91unb4n",
         "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/
hs389.snc4/45262_419686073499_40444963499_4941020_5615227_s.jpg",
         "link": "http://www.facebook.com/photo.php?pid=4941020&fbid=419686073499&id=40444963499",
         "name": "Fisheye Camera Photos",
         "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif",
         "type": "photo",
Most data
  requires
explicit user
 permission
Access Token

•Obtained when a user gives
 permissions to a Facebook
 application
•Used for making Graph API calls
 For testing, try: http://oauth.twoalex.com
Access Token Usage
https://graph.facebook.com/me?access_token=...
https://graph.facebook.com/me/feed?access_token=...
https://graph.facebook.com/me/likes?access_token=...
https://graph.facebook.com/me/friends?access_token=
https://graph.facebook.com/4/feed?access_token=...


              Explore Graph API:
       http://aiphone1.heroku.com
How to get an access token

• Redirect to OAuth
 • https://graph.facebook.com/oauth/authorize ...
 • https://graph.facebook.com/oauth/access_token ...
• Javascript SDK
 • User clicks on login button
 • SDK stores the access token into a cookie
Extended Permissions
When authenticating, can ask the user for
extended permissions:

• user_photos, friend_photos
• user_likes, friend_likes
• read_stream, publish_stream
• email
• offline_access
• and many more....
Graph API - Facebook Developer Garage Taipei
Graph API - Facebook Developer Garage Taipei
Graph API

•What is it?
• What to do?
• What’s new?
Types of Facebook Apps

• Canvas FBML
• Canvas iframe
• Website
• Mobile website
• Mobile (native)
• Desktop
Canvas apps


•   Canvas FBML
•   Canvas iframe
Canvas apps


•   Canvas FBML
•   Canvas iframe
Major Changes for Canvas Apps
By end of this year (2010):
1. Canvas FBML will be deprecated...
  you must use Canvas iframe!
2. The Facebook “session_key” will disappear...
  you must use access_token for API calls!
3. The “fb_sig” parameters will disappear...
  you must query and cache user data!
1. Must use canvas iframe

• Many FBML tags not supported in iframe
• Use Javascript SDK to get XFBML (which is a
  subset of FBML tags for iframe apps)
  <fb:name uid=’4’></fb:name>


• After end of 2010, FBML apps cannot be created.
2. Must use access token
  • You need to upgrade your SDK library
  • All calls to Facebook must be made with an
     access token:

      ‣ FQL Query
https://api.facebook.com/method/fql.query?query=...&access_token=...


      ‣ Old REST API calls
https://api.facebook.com/method/stream.publish?access_token=...

https://api.facebook.com/method/pages.isFan?page_id=...&access_token=...
Facebook’s PHP SDK
  http://github.com/facebook/php-sdk/

 $me = $facebook->api('/me');
 $mark = $facebook->api('/4');

 $loginUrl = $facebook->getLoginUrl();

 <a href="<?php echo $loginUrl; ?>">
   Click to Login
 </a>
Our Ruby SDK
http://github.com/cardinalblue/rest-graph
3. Must query and cache user data
• Instead of many “fb_sig” parameters, Facebook will
  only pass a signed_request (containing access
  token and user id)
• Many parameters will disappear, so you will need
  to query and cache them yourself...
• fb_sig_friends =>
  https://graph.facebook.com/me/friends?...
• fb_sig_locale =>
  https://api.facebook.com/methods/users.getInfo?...
Graph API - Facebook Developer Garage Taipei
Types of Facebook Apps
              Authentication         Markup        Access Token


Canvas
                                     FBML
 FBML                                                        signed
                                                            request
Canvas
iframe    Redirect to
            OAuth
                                              from cookie
                        Javascript
                                               (placed by
Website                    SDK       XFBML     Javascript
                                                  SDK)

Mobile
website
Summary: What to do?

• Switch to new SDK
• Use new login and get permissions
• Convert all FQL queries and Old REST
  API calls into Graph API calls

• Remove any references to fb_sig
• For performance, set up caching
Graph API

•What is it?
• What to do?
• What’s new?
What’s new?


• Open Graph Protocol
• Facebook Places API
anything can be an
               object
http://graph.facebook.com/http://www.facebook.com




           even an URL!
not much
information though
{
    "id": "http://www.facebook.com",
    "shares": 666837
}
but this one...
http://graph.facebook.com/http://www.imdb.com/title/tt0117500/


     {
       "id": "114324145263104",
       "name": "The Rock (1996)",
       "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/
     hs344.snc4/41581_114324145263104_7037_s.jpg",
       "link": "http://www.imdb.com/title/tt0117500/",
       "category": "Movie",
       "description": "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed
     Harris. A group of U.S. marines, under command of a renegade general, take over
     Alcatraz and threat San Francisco Bay with biological weapons. A chemical weapons
     specialist and the only man to have ever escaped from the Rock are the only ones
     who can prevent chaos. Visit IMDb for Photos, Showtimes, Cast, Crew, Reviews, Plot
     Summary, Comments, Discussions, Taglines, Trailers, Posters, Fan Sites",
       "fan_count": 931
     }
...has connections
http://graph.facebook.com/http://www.imdb.com/title/tt0117500?metadata=1


   {
       "id": "118133258218514",
       [...],
       "metadata": {
          "connections": {
             "feed": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/feed",
             "posts": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/posts",
             "tagged": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/tagged",
             "statuses": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/statuses",
             "links": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/links",
             "notes": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/notes",
             "photos": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/photos",
             "albums": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/albums",
             "events": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/events",
             "videos": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/videos"
          }
       },
       "type": "page"
   }
adding <meta> tag
 to any web page
   turns it into a
  facebook object
Open Graph Protocol
Facebook Places
Graph API for checkins
Extended permissions:
 user_checkins, friend_checkins


https://graph.facebook.com/[user id]/checkins
https://graph.facebook.com/[place page id]/checkins
https://graph.facebook.com/search?type=checkins
See where your friends have checked in:
http://fbfetcher.heroku.com/
        welcome/places
Graph API
• What is it?
  Simple new REST API with OAuth2.0
• What to do?
  Rewrite your apps using new SDKs
• What’s new?
  Open Graph, Facebook Places.
Graph API - Facebook Developer Garage Taipei

More Related Content

PPTX
The Flash Facebook Cookbook - FlashMidlands
PDF
Semantic Searchmonkey
PDF
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
PPTX
Case Study: Mysterious Google Search [Fave]
PDF
Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012
PPTX
Natural Language Movie Queries - Bing vs Google
PDF
The Kickstarter Blog
PDF
With Great Nerdery Comes Great Responsibility
The Flash Facebook Cookbook - FlashMidlands
Semantic Searchmonkey
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
Case Study: Mysterious Google Search [Fave]
Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012
Natural Language Movie Queries - Bing vs Google
The Kickstarter Blog
With Great Nerdery Comes Great Responsibility

Similar to Graph API - Facebook Developer Garage Taipei (20)

PDF
Traxo Presentation - Facebook Garage Dallas 09
PDF
Facebook Platform for Developers
PDF
Building an interactive timeline from facebook photos
PDF
Build social apps for Facebook
PPT
Facebook Coin
PDF
Charlie Cheever Facebook Developer Garage Uganda
PDF
Leveraging Rails to Build Facebook Apps
PDF
Developing Facebook Application
PPT
Creating a Facebook App
PDF
Building Facebook Apps
KEY
페이스북 소셜 앱 개발 가이드 2011
PPT
Happy facebook developer
PPTX
Alphageeks meetup - facebook api
PPT
Facebook API
PPT
Facebook api
PPT
Facebook + Ruby
ODP
Facebook Platform
PDF
funP 麻吉 開發者俱樂部十月份聚會
PDF
Facebook Connect Tutorial
Traxo Presentation - Facebook Garage Dallas 09
Facebook Platform for Developers
Building an interactive timeline from facebook photos
Build social apps for Facebook
Facebook Coin
Charlie Cheever Facebook Developer Garage Uganda
Leveraging Rails to Build Facebook Apps
Developing Facebook Application
Creating a Facebook App
Building Facebook Apps
페이스북 소셜 앱 개발 가이드 2011
Happy facebook developer
Alphageeks meetup - facebook api
Facebook API
Facebook api
Facebook + Ruby
Facebook Platform
funP 麻吉 開發者俱樂部十月份聚會
Facebook Connect Tutorial
Ad

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Spectroscopy.pptx food analysis technology
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Big Data Technologies - Introduction.pptx
Encapsulation theory and applications.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative analysis of optical character recognition models for extracting...
sap open course for s4hana steps from ECC to s4
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Ad

Graph API - Facebook Developer Garage Taipei

  • 1. Graph API Facebook Developer Garage Taipei CardinalBlue john, godfat @
  • 2. Graph API •What is it? • What to do? • What’s new?
  • 3. Graph API: What is it? • Launched at F8 (April 2010) • Simple REST API • Completely new!
  • 6. http://graph.facebook.com/hellokitty { "id": "40444963499", "name": "Hello Kitty", "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/ hs625.ash1/27537_40444963499_5441_s.jpg", "link": "http://www.facebook.com/hellokitty", "category": "Public_figures_other", "username": "hellokitty", "affiliation": "Sanrio Inc. USA", "birthday": "11/01/-001", "personal_info": "Hello Kitty's Official Fan Page!nHello Kitty lives in the suburbs of London with her parents and her twin sister Mimmy. She has lots of friends at school with whom she shares many adventures.nHer trademark is her red bow that she always wears over her left ear.nHello Kitty is as heavy as three apples and as tall as five apples.", "personal_interests": "Traveling, listening to music, reading, eating yummy cookies, and making new friends. As Hello Kitty always says, u201cYou can never have too many friends!"nShe collects small, cute objects like ribbons, hair accessories, candy, stars, and goldfish.", "fan_count": 267913, "type": "page" }
  • 7. Connections http://graph.facebook.com/hellokitty?metadata=1 "metadata": { "connections": { "feed": "http://graph.facebook.com/hellokitty/feed", "posts": "http://graph.facebook.com/hellokitty/posts", "tagged": "http://graph.facebook.com/hellokitty/tagged", "statuses": "http://graph.facebook.com/hellokitty/statuses", "links": "http://graph.facebook.com/hellokitty/links", "notes": "http://graph.facebook.com/hellokitty/notes", "photos": "http://graph.facebook.com/hellokitty/photos", "albums": "http://graph.facebook.com/hellokitty/albums", "events": "http://graph.facebook.com/hellokitty/events", "videos": "http://graph.facebook.com/hellokitty/videos" } }
  • 8. object connection objects
  • 9. http://graph.facebook.com/hellokitty/posts { "data": [ { "id": "40444963499_420034668499", "from": { "name": "Hello Kitty", "category": "Public_figures_other", "id": "40444963499" }, "message": "Check out the cute Hello Kitty Nerds tote featured in Us Weekly! Find this and more Hello Kitty u201cNerdsu201d stuff at Sanrio.com and select Sanrio Boutiques.nnhttp://bit.ly/brVYHTn", "picture": "http://photos-h.ak.fbcdn.net/hphotos-ak-ash2/ hs003.ash2/33501_420032663499_40444963499_4947695_6515646_s.jpg", "link": "http://www.facebook.com/photo.php?pid=4947695&fbid=420032663499&id=40444963499", "name": "Nerd Alert!", "caption": "5 new photos", "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif", "type": "photo", "created_time": "2010-08-20T01:04:30+0000", "updated_time": "2010-08-20T01:04:30+0000", "likes": 892, "comments": { "count": 76 } }, { "id": "40444963499_419689583499", "from": { "name": "Hello Kitty", "category": "Public_figures_other", "id": "40444963499" }, "message": "Weu2019ve been playing with the Hello Kitty 35 mm Fisheye camera by Lomography and wanted to share some of the fun pictures weu2019ve taken! Has anyone else taken any awesome pictures with their Hello Kitty Fisheye cameras? Post them to our wall, we wanna see them! nnThe Hello Kitty Fisheye Camera is now available at Sanrio.com, select Sanrio Boutiques, Urban Outfitters, Lomography.com and Lomography gallery stores. nnhttp://bit.ly/91unb4n", "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/ hs389.snc4/45262_419686073499_40444963499_4941020_5615227_s.jpg", "link": "http://www.facebook.com/photo.php?pid=4941020&fbid=419686073499&id=40444963499", "name": "Fisheye Camera Photos", "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif", "type": "photo",
  • 10. Most data requires explicit user permission
  • 11. Access Token •Obtained when a user gives permissions to a Facebook application •Used for making Graph API calls For testing, try: http://oauth.twoalex.com
  • 13. How to get an access token • Redirect to OAuth • https://graph.facebook.com/oauth/authorize ... • https://graph.facebook.com/oauth/access_token ... • Javascript SDK • User clicks on login button • SDK stores the access token into a cookie
  • 14. Extended Permissions When authenticating, can ask the user for extended permissions: • user_photos, friend_photos • user_likes, friend_likes • read_stream, publish_stream • email • offline_access • and many more....
  • 17. Graph API •What is it? • What to do? • What’s new?
  • 18. Types of Facebook Apps • Canvas FBML • Canvas iframe • Website • Mobile website • Mobile (native) • Desktop
  • 19. Canvas apps • Canvas FBML • Canvas iframe
  • 20. Canvas apps • Canvas FBML • Canvas iframe
  • 21. Major Changes for Canvas Apps By end of this year (2010): 1. Canvas FBML will be deprecated... you must use Canvas iframe! 2. The Facebook “session_key” will disappear... you must use access_token for API calls! 3. The “fb_sig” parameters will disappear... you must query and cache user data!
  • 22. 1. Must use canvas iframe • Many FBML tags not supported in iframe • Use Javascript SDK to get XFBML (which is a subset of FBML tags for iframe apps) <fb:name uid=’4’></fb:name> • After end of 2010, FBML apps cannot be created.
  • 23. 2. Must use access token • You need to upgrade your SDK library • All calls to Facebook must be made with an access token: ‣ FQL Query https://api.facebook.com/method/fql.query?query=...&access_token=... ‣ Old REST API calls https://api.facebook.com/method/stream.publish?access_token=... https://api.facebook.com/method/pages.isFan?page_id=...&access_token=...
  • 24. Facebook’s PHP SDK http://github.com/facebook/php-sdk/  $me = $facebook->api('/me'); $mark = $facebook->api('/4'); $loginUrl = $facebook->getLoginUrl(); <a href="<?php echo $loginUrl; ?>"> Click to Login </a>
  • 26. 3. Must query and cache user data • Instead of many “fb_sig” parameters, Facebook will only pass a signed_request (containing access token and user id) • Many parameters will disappear, so you will need to query and cache them yourself... • fb_sig_friends => https://graph.facebook.com/me/friends?... • fb_sig_locale => https://api.facebook.com/methods/users.getInfo?...
  • 28. Types of Facebook Apps Authentication Markup Access Token Canvas FBML FBML signed request Canvas iframe Redirect to OAuth from cookie Javascript (placed by Website SDK XFBML Javascript SDK) Mobile website
  • 29. Summary: What to do? • Switch to new SDK • Use new login and get permissions • Convert all FQL queries and Old REST API calls into Graph API calls • Remove any references to fb_sig • For performance, set up caching
  • 30. Graph API •What is it? • What to do? • What’s new?
  • 31. What’s new? • Open Graph Protocol • Facebook Places API
  • 32. anything can be an object http://graph.facebook.com/http://www.facebook.com even an URL!
  • 33. not much information though { "id": "http://www.facebook.com", "shares": 666837 }
  • 34. but this one... http://graph.facebook.com/http://www.imdb.com/title/tt0117500/ { "id": "114324145263104", "name": "The Rock (1996)", "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/ hs344.snc4/41581_114324145263104_7037_s.jpg", "link": "http://www.imdb.com/title/tt0117500/", "category": "Movie", "description": "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris. A group of U.S. marines, under command of a renegade general, take over Alcatraz and threat San Francisco Bay with biological weapons. A chemical weapons specialist and the only man to have ever escaped from the Rock are the only ones who can prevent chaos. Visit IMDb for Photos, Showtimes, Cast, Crew, Reviews, Plot Summary, Comments, Discussions, Taglines, Trailers, Posters, Fan Sites", "fan_count": 931 }
  • 35. ...has connections http://graph.facebook.com/http://www.imdb.com/title/tt0117500?metadata=1 { "id": "118133258218514", [...], "metadata": { "connections": { "feed": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/feed", "posts": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/posts", "tagged": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/tagged", "statuses": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/statuses", "links": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/links", "notes": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/notes", "photos": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/photos", "albums": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/albums", "events": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/events", "videos": "http://graph.facebook.com/http://www.imdb.com/title/tt0117500/videos" } }, "type": "page" }
  • 36. adding <meta> tag to any web page turns it into a facebook object
  • 39. Graph API for checkins Extended permissions: user_checkins, friend_checkins https://graph.facebook.com/[user id]/checkins https://graph.facebook.com/[place page id]/checkins https://graph.facebook.com/search?type=checkins
  • 40. See where your friends have checked in: http://fbfetcher.heroku.com/ welcome/places
  • 41. Graph API • What is it? Simple new REST API with OAuth2.0 • What to do? Rewrite your apps using new SDKs • What’s new? Open Graph, Facebook Places.